﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package reprise.utils {

    public class MathUtil {

        public static function randomSign():Number{
            return (((Math.round(Math.random()) < 1)) ? -1 : 1);
        }
        public static function tan(_arg1:Number):Number{
            return (Math.tan((_arg1 * (Math.PI / 180))));
        }
        public static function randomBetween(_arg1:Number, _arg2:Number):Number{
            return ((Math.ceil((Math.random() * ((_arg2 - _arg1) + 1))) + (_arg1 - 1)));
        }
        public static function acos(_arg1:Number):Number{
            return ((Math.acos(_arg1) * (180 / Math.PI)));
        }
        public static function cos(_arg1:Number):Number{
            return (Math.cos((_arg1 * (Math.PI / 180))));
        }
        public static function atan(_arg1:Number, _arg2:Number):Number{
            return ((Math.atan2(_arg2, _arg1) * (180 / Math.PI)));
        }
        public static function round(_arg1:Number, _arg2:uint=0):Number{
            var _local3:uint = Math.pow(10, _arg2);
            return ((Math.round((_arg1 * _local3)) / _local3));
        }
        public static function randomFloatBetween(_arg1:Number, _arg2:Number, _arg3:Number=1):Number{
            _arg3 = 1;
            var _local4:Number = Math.pow(10, _arg3);
            return ((MathUtil.randomBetween((_local4 * _arg1), (_local4 * _arg2)) / _local4));
        }
        public static function clip(_arg1:Number, _arg2:Number, _arg3:Number):Number{
            return (Math.max(_arg2, Math.min(_arg3, _arg1)));
        }
        public static function degreesToRadians(_arg1:Number):Number{
            return ((_arg1 * (Math.PI / 180)));
        }
        public static function sin(_arg1:Number):Number{
            return (Math.sin((_arg1 * (Math.PI / 180))));
        }
        public static function radiansToDegrees(_arg1:Number):Number{
            return ((_arg1 * (180 / Math.PI)));
        }
        public static function floatsEqual(_arg1:Number, _arg2:Number, _arg3:Number=1E-6):Boolean{
            return ((Math.abs((_arg1 - _arg2)) < _arg3));
        }
        public static function asin(_arg1:Number):Number{
            return ((Math.asin(_arg1) * (180 / Math.PI)));
        }

    }
}//package reprise.utils 
